test(fuzz): add lockfree/resilience fuzz harness + weekly workflow (DRAFT)#701
Merged
Conversation
…orkflow Add a libFuzzer harness targeting the thread-safe queue reachable through the lock-free compatibility include path (kcenon::thread::detail::concurrent_queue, the backing for <kcenon/thread/lockfree/lockfree_queue.h>). The harness drives a fuzzer-controlled opcode stream over enqueue (copy/move), try_dequeue including the empty path, wait_dequeue(timeout), empty()/size() queries, shutdown()/is_shutdown() resilience signalling, and FIFO round-trip integrity. - fuzz/concurrent_queue_fuzzer.cpp: LLVMFuzzerTestOneInput harness - fuzz/CMakeLists.txt: target gated behind BUILD_FUZZERS (Clang only, -fsanitize=fuzzer,address); excluded from the default build and the regular CI matrix; header-only (no library link or vcpkg needed) - fuzz/corpus: seed inputs exercising the major code paths - fuzz/README.md: local build/run instructions and follow-ups - .github/workflows/fuzzing.yml: weekly schedule + workflow_dispatch, builds with clang+libFuzzer and runs the harness for a bounded time - CMakeLists.txt: add BUILD_FUZZERS option (default OFF) and wiring Phased coverage raise (40/50/60%) and a dedicated lockfree_job_queue target remain as follow-ups under the same issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #697
Status: DRAFT
The fuzz harness is header-only (it includes the queue headers directly; no vcpkg, no GTest, no common_system link), so it was largely verifiable locally:
-fsanitize=address, no diagnostics).libclang_rt.fuzzer_osx.a. The link and short run will execute on the CI runner (Linux clang, which ships the libFuzzer runtime). The ecosystem vcpkg-hash infra failure is irrelevant here because this target does not depend on vcpkg.Kept as DRAFT because (a) the libFuzzer link/run is unverified outside CI, and (b) the broader phased coverage raise that is part of this issue is not done yet.
Done
fuzz/concurrent_queue_fuzzer.cpp— libFuzzer harness (LLVMFuzzerTestOneInput) targeting the thread-safe queue reachable via the lock-free compatibility include path (kcenon::thread::detail::concurrent_queue, the backing for<kcenon/thread/lockfree/lockfree_queue.h>): enqueue (copy/move),try_dequeueincl. the empty path,wait_dequeue(timeout),empty()/size()queries,shutdown()/is_shutdown()resilience signalling, and FIFO round-trip integrity vs a shadow model.BUILD_FUZZERSCMake option (default OFF) +fuzz/CMakeLists.txttarget gated on Clang with-fsanitize=fuzzer,address; excluded from the default build and the regular CI matrix.fuzz/corpus/, 3 seeds) exercising the major code paths..github/workflows/fuzzing.yml— weekly cron +workflow_dispatch, builds the header-only harness directly with clang+libFuzzer and runs it for a bounded time; uploads crash artifacts on failure.fuzz/README.md— local build/run instructions and follow-ups.Follow-ups (under #697)
kcenon::thread::lockfree_job_queue(Michael-Scott + hazard pointers). That one needs the full library link (src/lockfree,job, common_systemresult<T>), so it is deferred until the harness can link the library cleanly in CI.Risks